<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- Copyright © 1988-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<title>Libgcc (GNU Compiler Collection (GCC) Internals)</title>

<meta name="description" content="Libgcc (GNU Compiler Collection (GCC) Internals)">
<meta name="keywords" content="Libgcc (GNU Compiler Collection (GCC) Internals)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Option-Index.html" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="index.html" rel="up" title="Top">
<link href="Languages.html" rel="next" title="Languages">
<link href="Interface.html" rel="prev" title="Interface">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
span:hover a.copiable-link {visibility: visible}
-->
</style>


</head>

<body lang="en">
<div class="chapter-level-extent" id="Libgcc">
<div class="nav-panel">
<p>
Next: <a href="Languages.html" accesskey="n" rel="next">Language Front Ends in GCC</a>, Previous: <a href="Interface.html" accesskey="p" rel="prev">Interfacing to GCC Output</a>, Up: <a href="index.html" accesskey="u" rel="up">Introduction</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h2 class="chapter" id="The-GCC-low_002dlevel-runtime-library"><span>4 The GCC low-level runtime library<a class="copiable-link" href="#The-GCC-low_002dlevel-runtime-library"> &para;</a></span></h2>

<p>GCC provides a low-level runtime library, <samp class="file">libgcc.a</samp> or
<samp class="file">libgcc_s.so.1</samp> on some platforms.  GCC generates calls to
routines in this library automatically, whenever it needs to perform
some operation that is too complicated to emit inline code for.
</p>
<p>Most of the routines in <code class="code">libgcc</code> handle arithmetic operations
that the target processor cannot perform directly.  This includes
integer multiply and divide on some machines, and all floating-point
and fixed-point operations on other machines.  <code class="code">libgcc</code> also includes
routines for exception handling, and a handful of miscellaneous operations.
</p>
<p>Some of these routines can be defined in mostly machine-independent C.
Others must be hand-written in assembly language for each processor
that needs them.
</p>
<p>GCC will also generate calls to C library routines, such as
<code class="code">memcpy</code> and <code class="code">memset</code>, in some cases.  The set of routines
that GCC may possibly use is documented in <a data-manual="gcc" href="https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#Other-Builtins">Other
Builtins</a> in <cite class="cite">Using the GNU Compiler Collection (GCC)</cite>.
</p>
<p>These routines take arguments and return values of a specific machine
mode, not a specific C type.  See <a class="xref" href="Machine-Modes.html">Machine Modes</a>, for an explanation
of this concept.  For illustrative purposes, in this chapter the
floating point type <code class="code">float</code> is assumed to correspond to <code class="code">SFmode</code>;
<code class="code">double</code> to <code class="code">DFmode</code>; and <code class="code">long&nbsp;double<!-- /@w --></code> to both
<code class="code">TFmode</code> and <code class="code">XFmode</code>.  Similarly, the integer types <code class="code">int</code>
and <code class="code">unsigned&nbsp;int<!-- /@w --></code> correspond to <code class="code">SImode</code>; <code class="code">long</code> and
<code class="code">unsigned&nbsp;long<!-- /@w --></code> to <code class="code">DImode</code>; and <code class="code">long&nbsp;long<!-- /@w --></code> and
<code class="code">unsigned&nbsp;long&nbsp;long<!-- /@w --></code> to <code class="code">TImode</code>.
</p>

<ul class="mini-toc">
<li><a href="Integer-library-routines.html" accesskey="1">Routines for integer arithmetic</a></li>
<li><a href="Soft-float-library-routines.html" accesskey="2">Routines for floating point emulation</a></li>
<li><a href="Decimal-float-library-routines.html" accesskey="3">Routines for decimal floating point emulation</a></li>
<li><a href="Fixed_002dpoint-fractional-library-routines.html" accesskey="4">Routines for fixed-point fractional emulation</a></li>
<li><a href="Exception-handling-routines.html" accesskey="5">Language-independent routines for exception handling</a></li>
<li><a href="Miscellaneous-routines.html" accesskey="6">Miscellaneous runtime library routines</a></li>
</ul>
</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="Languages.html">Language Front Ends in GCC</a>, Previous: <a href="Interface.html">Interfacing to GCC Output</a>, Up: <a href="index.html">Introduction</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>
